<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<form id="f1">
    <input placeholder="昵称" id="sname" />
    <input placeholder="手机号码" id="tel" />
    <input placeholder="验证码" id="yzm" />
    <input type="password" placeholder="密码" id="pwd" />
    <input type="button" id="regBtn" value="注册" />
</form>

<script src="jquery.js"></script>

<script>

 
    regBtn.onclick = function(){
      $.post("https://java60.hfbdqn.cn/reg",
             {name:sname.value,tel:tel.value,yzm:yzm.value,pwd:pwd.value},
             function(data){
                if(data){
                    alert("注册成功！");

                    location = "login.html";
                }else{
                    alert("注册失败！");
                }
             }
      );
    };
</script>
</body>
</html>












